package com.loeng.module.infra.controller.admin.logger.vo.apiaccesslog;

import com.loeng.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

import static com.loeng.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * API 访问日志分页 Request VO
 * @author loeng zhuo
 */
@Schema(description = "管理后台 - API 访问日志分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ApiAccessLogPageReqVO extends PageParam {

    @Schema(description = "链路追踪编号", example = "6149")
    private String traceId;

    @Schema(description = "用户编号", example = "1821")
    private Long userId;

    @Schema(description = "用户类型", example = "2")
    private Integer userType;

    @Schema(description = "应用名", example = "张三")
    private String applicationName;

    @Schema(description = "请求方法名")
    private String requestMethod;

    @Schema(description = "请求地址", example = "https://www.iocoder.cn")
    private String requestUrl;

    @Schema(description = "请求参数")
    private String requestParams;

    @Schema(description = "响应结果")
    private String responseBody;

    @Schema(description = "用户 IP")
    private String userIp;

    @Schema(description = "浏览器 UA")
    private String userAgent;

    @Schema(description = "操作模块")
    private String operateModule;

    @Schema(description = "操作名", example = "赵六")
    private String operateName;

    @Schema(description = "操作分类", example = "2")
    private Integer operateType;

    @Schema(description = "开始请求时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] beginTime;

    @Schema(description = "结束请求时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] endTime;

    @Schema(description = "执行时长")
    private Integer duration;

    @Schema(description = "结果码")
    private Integer resultCode;

    @Schema(description = "结果提示")
    private String resultMsg;

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

}